package ca.uguu.unknown_space.worldobjects;

import java.util.ArrayList;

import ca.uguu.gamelib.libgdx.concepts.PhysicsScene;
import ca.uguu.unknown_space.worldobjects.background.Vessel;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.utils.Disposable;

public class BattleScene extends PhysicsScene implements Disposable {
	private ArrayList<Ship> playerShips;
	private ArrayList<Vessel> alliedVessels;
	private ArrayList<Vessel> neutralVessels;
	private ArrayList<Vessel> enemyVessels;
	//TODO: It probably makes sense to have a TextureAtlas of all projectiles and expose a getProjectile() method.
	//Impact and lighting effects, too.
	
	public BattleScene(){
		super();
	}
	
	@Override
	public void dispose(){
		super.dispose();
		for(Ship ship : this.playerShips){
			ship.dispose();
		}
		for(Vessel vessel : this.alliedVessels){
			vessel.dispose();
		}
		for(Vessel vessel : this.neutralVessels){
			vessel.dispose();
		}
		for(Vessel vessel : this.enemyVessels){
			vessel.dispose();
		}
		//TODO: Also needs to dispose projectiles
	}
	
	@Override
	public void clear(){
		Gdx.gl.glClearColor(0, 0, 0, 1);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		//Draw stars and stuff
		//If this is a planning phase, and I don't decide to render effects, this is a no-op and shouldn't even be called.
	}
	
	@Override
	public void render(Iterable<Sprite> sprites, boolean debug){
		super.render(sprites, debug);
		this.renderBattle();
	}
	
	private void renderBattle(){
		//Draw all ships and projectiles
	}
	
	@Override
	public void markResumed(){
		
	}
}
